<template>
    <div>
        <p>{{content}}</p>
        <button @click="emitSelfEvent">emit</button>
    </div>
</template>

<script>
export default{
    data(){
        return {
            content:'this is my component content'
        }
    },
    methods:{
        emitSelfEvent(){    // 触发本组件的自定义事件
            this.$emit('self-event',this.content)
        }
    }
}
</script>